#include<stdio.h>
int main(){
	int n,i;
	scanf("%d",&n);
	int num,j;
	for(i=0;i<n;i++)
	{
		scanf("%d",&num);
		if(num%2==0){
			for(j=2;j<=num;j++){
				if(num%j==0&&j%2==0)
				printf("%d ",j);
			}
		}
		else{
			printf("%dhas no even factors\n",num);
			
		}
		
		
		
	}
	
	
	return 0;
}
